{template 'public/header'}
<link rel="stylesheet" type="text/css" href="../addons/yzzc_sun/template/public/ygcss.css">

<ul class="nav nav-tabs">
    <span class="ygxian"></span>
    <div class="ygdangq">当前位置:</div>
    <li class="active"><a href="javascript:void(0);">会员特权设置</a></li>
</ul>

<div class="main">
    <form action="" method="post" class="form-horizontal form" enctype="multipart/form-data">
        <!--<input type="hidden" name="parentid" value="{$parent['id']}" />-->
        <div class="panel panel-default ygdefault">
            <div class="panel-heading wyheader">
                等级设置
            </div>
            <div class="panel-body">
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">会员等级名称</label>
                    <div class="col-sm-4">
                        <p class="input-group" style="margin-bottom: 0px;">
                            <input type="text" name="level_name" value="{$item['level_name']}" id="points" class="form-control" />
                        </p>
                        <div class="help-block">*请输入会员等级，如下：初级会员</div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">等级所需积分</label>
                    <div class="col-sm-4">
                        <p class="input-group" style="margin-bottom: 0px;">
                            <input type="number" name="level_score" value="{$item['level_score']}"  class="form-control"  style="width: 390px;"/>
                        </p>
                        <div class="help-block">*请输入等级积分</div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">等级图标</label>
                    <div class="col-sm-9">
                        {php echo tpl_form_field_image('level_img', $item['level_img']);}
                        <span class="help-block">*建议比例 1:1</span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">会员特权</label>
                    <div class="col-sm-10">
                        <input onchange="check(this)" type="radio" value="1" name="level_privileges" {if $item['level_privileges']==1 || empty($item['level_privileges'])}checked{/if} >无特权
                        <input onchange="check(this)" type="radio" value="2" name="level_privileges" {if $item['level_privileges']==2}checked{/if} >免收基础服务费
                        <input onchange="check(this)" type="radio" value="3" name="level_privileges" {if $item['level_privileges']==3}checked{/if}>延迟还车

                        <input type="number" name="delay" placeholder="延迟几小时还车，单位：小时"  value="{$item['delay']}">
                    </div>
                </div>
            </div>

        </div>

        <div class="form-group">
            <input type="submit" name="submit" value="提交" class="btn col-lg-3" style="color: white;background-color: #444444;margin-left: 550px;"/>
            <input type="hidden" name="token" value="{$_W['token']}" />
            <input type="hidden" name="id" value="{$item['id']}" />
        </div>
    </form>
</div>
<script type="text/javascript">
    $(function(){
        $("#frame-11").show();
        $("#yframe-11").addClass("wyactive");
        if($('input[name="delay"]').val()==0){
            $('input[name="delay"]') .hide();
        }
    });
    function check() {
       var a= $('input[name="level_privileges"]:checked').val()
       if(a==3){
           $('input[name="delay"]') .show();
       }else{
           $('input[name="delay"]') .hide();
       }
    }
</script>